﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("BC")]
namespace BE.Abastos
{
    public class Measures
    {
        public int? iMeasureId { get; set; }
        public string sMeasureName { get; set; }
        public DateTime dtModifies { get; set; }

        internal Measures Create()
        {
            try
            {
                Measures result = new Measures();
                using (DAL.Abastos.MeasuresDA<Measures> datos = new DAL.Abastos.MeasuresDA<Measures>())
                {
                    result = datos.Create(this.sMeasureName);
                }
                return result;
            }
            catch (Exception ex)
            {
                throw new BE.AppException("Measures - Create - ", ex);
            }
        }
        internal List<Measures> Select()
        {
            try
            {
                List<Measures> lista = new List<Measures>();
                using (DAL.Abastos.MeasuresDA<Measures> datos = new DAL.Abastos.MeasuresDA<Measures>())
                {
                    lista = datos.Select(this.iMeasureId, this.sMeasureName);
                }

                return lista;
            }
            catch (Exception ex)
            {
                throw new BE.AppException("Measures - Select - ", ex);
            }
            
        }
    }
}
